//
//  pulicMath.h
//  充电桩
//
//  Created by 李超杰 on 17/4/19.
//  Copyright © 2017年 李超杰. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface pulicMath : NSObject<CAAnimationDelegate>

@property(nonatomic,strong)NSMutableDictionary *dataDic;
@property(nonatomic,strong)NSMutableDictionary *postDic;

@property(nonatomic,strong)NSString *controllerType;//标记从哪个页面跳转到登录页


//GET封装方法－－－登陆之前的方法
-(NSMutableDictionary *)getData:(NSString *)url dic:(NSMutableDictionary *)dic;
//post封装方法－－－－－登陆之前的方法
-(NSMutableDictionary *)postData:(NSString *)url dic:(NSMutableDictionary *)postDic;
//post封装方法－－－－－登陆之前的方法 替换上面方法
- (void)postLoginDataWithURLString:(NSString *)URLString
                        parameters:(id)parameters
                           success:(void (^)(NSDictionary * dictionary))success
                           failure:(void (^)(NSError * error))failure;

-(NSDictionary *)newPostRequset:(NSMutableDictionary *)dic getUrl:(NSString *)url successBlock:(void(^)(NSDictionary * sucDic))block;
//判断字符串是否为空
- (BOOL)isBlankString:(NSString *)string;

//判断手机号码格式是否正确
-(BOOL)valiMobile:(NSString *)mobile;

//密码判断
-(BOOL)checkPassWord:(NSString *)str;

//网址拼接
-(NSMutableString *)URLAppend:(NSString *)url;
//h5 网址拼接
-(NSMutableString *)H5URLAppend:(NSString *)url;

//固定参数
-(NSMutableDictionary *)postParameters:(NSMutableDictionary *)mutableDic;

////GET封装方法－－－登陆之前的方法
//-(NSMutableDictionary *)getData:(NSString *)url dic:(NSMutableDictionary *)dic str:(NSString *)token;
////post封装方法－－－－－登陆之前的方法
//-(NSMutableDictionary *)postData:(NSString *)url dic:(NSMutableDictionary *)postDic str:(NSString *)token;
//

-(NSString *)token;

-(NSString *)version;

//高德的key

-(NSString *)GDMap;
//退出登录
-(void)NewExitLoagin:(NSDictionary *)dictionary FromViewControler:(UIViewController *)controller successBlock:(void(^)(NSDictionary *successDictionary))successblock andError:(void(^)(NSDictionary *errorDictionary))errorblock;

//判断是否登录
-(BOOL)checkLoagin;

-(void)exitLoagin;
//从哪个页面跳登录
-(void)gotoLoginFronVC:(UIViewController *)controller;

- (NSString*)dictionaryToJson:(NSDictionary *)dic;

-(UIImageView *)loadingGifImage;

//旋转动画 返回一个UIImageView
- (UIWebView *)circleBasicAnimation;
//清除友盟userid
-(void)removeUMAliasuserid:(NSString *)userid;
//生成二维码，并且变清晰 string:需要生成的字符串；UIImage* 返回image；
-(UIImage *)getQR:(NSString *)string;
#pragma mark 获取字符串宽高 value-待计算字符串 fontSize-字体大小 WHmake-控件宽高
-(CGRect) widthForString:(NSString *)value fontSize:(float)fontSize andWH:(CGSize)WHmake;

//写数据
- (void)writeLocalCacheData:(NSData *)data withKey:(NSString *)key;
//读数据
- (NSData *)readLocalCacheDataWithKey:(NSString *)key;

@end
